package test.db.table.mysql.type;

import test.db.table.Table;

/**
 * @author newbie
 * @since 0.1
 */
public enum PwBbsHistoryTable implements Table, ColumnType {
    SID(Column.sid),
    BBS_NO(Column.bbsNo),
    CATEGORY_SID(Column.categorySid),
    BBS_ID(Column.bbsId),
    DEPTH(Column.depth),
    BBS_ICON(Column.bbsIcon),
    USER_SID(Column.userSid),
    USER_PASSWD(Column.userPasswd),
    USER_NICK(Column.userNick),
    USER_ICON(Column.userIcon),
    USER_IP(Column.userIp),
    USER_EMAIL(Column.userEmail),
    USER_HOMEPAGE(Column.userHomepage),
    USER_COUNTRY(Column.userCountry),
    TITLE(Column.title),
    CONTENT(Column.content),
    FILE_CNT(Column.fileCnt),
    TAG_CNT(Column.tagCnt),
    NOTICE_YN(Column.noticeYn),
    BEST_YN(Column.bestYn),
    SECRET_YN(Column.secretYn),
    EDIT_YN(Column.editYn),
    POLL_START(Column.pollStart),
    POLL_END(Column.pollEnd),
    TAG_NAME(Column.tagName),
    TAG_SID(Column.tagSid),
    THUMBNAIL_IMG(Column.thumbnailImg),
    REGIST_TIMESTAMP(Column.registTimestamp);
    
    private final Column column;

    private static final String TYPE_DEPTH = "INT(3)";
    private static final String TYPE_BBS_ICON = "VARCHAR(255)";
    private static final String TYPE_TITLE = "VARCHAR(255)";
    private static final String TYPE_CONTENT = "MEDIUMTEXT";
    private static final String TYPE_FILE_CNT = "INT(3)";
    private static final String TYPE_TAG_CNT = "INT(3)";
    private static final String TYPE_NOTICE_YN = "CHAR(1)";
    private static final String TYPE_BEST_YN = "CHAR(1)";
    private static final String TYPE_SECRET_YN = "CHAR(1)";
    private static final String TYPE_EDIT_YN = "CHAR(1)";
    private static final String TYPE_POLL_START = "VARCHAR(12)";
    private static final String TYPE_POLL_END = "VARCHAR(12)";
    private static final String TYPE_TAG_NAME = "VARCHAR(255)";
    private static final String TYPE_TAG_SID = "BIGINT(18)";
    private static final String TYPE_THUMBNAIL_IMG = "VARCHAR(100)";

    PwBbsHistoryTable(Column column) {
        this.column = column;
    }
    
    private enum Column {
        sid {
            String getType() {
                return TYPE_SID;
            }
        },
        
        bbsNo {
            String getType() {
                return TYPE_BBS_NO;
            }
        },
        
        categorySid {
            String getType() {
                return TYPE_CATEGORY_SID;
            }
        },
        
        bbsId {
            String getType() {
                return TYPE_BBS_ID;
            }
        },
        
        depth {
            String getType() {
                return TYPE_DEPTH;
            }
        },
        
        bbsIcon {
            String getType() {
                return TYPE_BBS_ICON;
            }
        },
        
        userSid {
        	String getType() {
        		return TYPE_USER_SID;
        	}
        },
        
        userPasswd {
        	String getType() {
        		return TYPE_USER_PASSWD;
        	}
        },
        
        userNick {
        	String getType() {
        		return TYPE_USER_NICK;
        	}
        },
        
        userIcon {
        	String getType() {
        		return TYPE_USER_ICON;
        	}
        },
        
        userIp {
        	String getType() {
        		return TYPE_USER_IP;
        	}
        },
        
        userEmail {
        	String getType() {
        		return TYPE_USER_EMAIL;
        	}
        },
        
        userHomepage {
        	String getType() {
        		return TYPE_USER_HOMEPAGE;
        	}
        },
        
        userCountry {
        	String getType() {
        		return TYPE_USER_COUNTRY;
        	}
        },
        
        title {
        	String getType() {
        		return TYPE_TITLE;
        	}
        },
        
        content {
        	String getType() {
        		return TYPE_CONTENT;
        	}
        },
 
        fileCnt {
        	String getType() {
        		return TYPE_FILE_CNT;
        	}
        },
        
        tagCnt {
        	String getType() {
        		return TYPE_TAG_CNT;
        	}
        },
 
        noticeYn {
        	String getType() {
        		return TYPE_NOTICE_YN;
        	}
        },
        
        bestYn {
        	String getType() {
        		return TYPE_BEST_YN;
        	}
        },
        
        secretYn {
        	String getType() {
        		return TYPE_SECRET_YN;
        	}
        },
        
        editYn {
        	String getType() {
        		return TYPE_EDIT_YN;
        	}
        },
        
        pollStart {
        	String getType() {
        		return TYPE_POLL_START;
        	}
        },
        
        pollEnd {
        	String getType() {
        		return TYPE_POLL_END;
        	}
        },
        
        tagName {
        	String getType() {
        		return TYPE_TAG_NAME;
        	}
        },
        
        tagSid {
        	String getType() {
        		return TYPE_TAG_SID;
        	}
        },
        
        thumbnailImg {
        	String getType() {
        		return TYPE_THUMBNAIL_IMG;
        	}
        },
        
        registTimestamp {
        	String getType() {
        		return TYPE_REGIST_TIMESTAMP;
        	}
        };
        
        abstract String getType();
    }
    
    public String getType() {
        return column.getType();
    }
    
    public void initData() throws Exception {
    }
}